const state = {
    userid: sessionStorage.getItem('USERID'),
    addRouters: []

}
const mutations = {
    // 存userid
    getUserId(state, userid) {
        state.userid = userid

    },
    // 保存动态路由
    generateRoutes(state, addRouters) {
        state.addRouters = addRouters
    }
}

const actions = {
    // 派发权限的actions 获取token/uuid
    getUserId({ commit }) {
        let userid = sessionStorage.getItem('USERID')
        commit('getUserId', userid)
    },
    // 获取保存 动态路由
    generateRoutes({ commit }, data) {
        commit('generateRoutes', data)

    }
}
const getters = {}

export default {
    state,
    actions,
    mutations,
    getters

}